<%--
  Created by IntelliJ IDEA.
  User: 凉夏
  Date: 2024/4/9
  Time: 10:54
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <%
        String path = request.getContextPath();
        String basePath = request.getScheme() + "://" + request.getServerName() + ":" +
                request.getServerPort() + path + "/";
    %>
    <base href="<%=basePath%>">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>贵美商城</title>
    <link rel="stylesheet" type="text/css" href="css/global.css"/>
    <link rel="stylesheet" type="text/css" href="css/error.css"/>
    <link rel="stylesheet" type="text/css" href="css/layout.css"/>
    <script type="text/javascript" src="script/jquery-1.7.2.js"></script>
    <script type="text/javascript">
        $(function () {
            $("#sub_btn").click(function () {
                var usernameText = $("#username").val();
                var usernameReg = /^[a-z0-9_-]{3,16}$/
                if (!usernameReg.test(usernameText)) {
                    $("span.errorMsg").text("用户名不合法")
                    return false;
                }
                var passwordText = $("#password").val();
                var passwordReg = /^[a-z0-9_-]{6,18}$/
                if (!passwordReg.test(passwordText)) {
                    $("span.errorMsg").text("密码不合法")
                    return false;
                }
            })
        })

    </script>
</head>
<body>

<div id="container">
    <iframe id="header" src="http://localhost:8080/shopping/header.jsp" width="980" height="136" frameborder="0" scrolling="no"></iframe>
    <form action="http://localhost:8080/shopping/sessionServlet" method="get">
        <div class="login">
            <ul class="form f_l">
                <h1><img src="http://localhost:8080/shopping/images/logintitle.gif" alt="会员登录"/></h1>
                <li class="login_list"><label>会员名：</label><input type="text" name="username" value="${cookie.username.value}" id="username" />（可包含
                    a-z、0-9 和下划线）
                </li>
                <li class="login_list"><label>密&nbsp;&nbsp;&nbsp;码：</label><input type="text" name="password" value="${cookie.password.value}"
                                                                                    id="password" />（至少包含 6
                    个字符）
                </li>
<%--                <li class="a_c"><a href="http://localhost:8080/shopping/sessionServlet" target="_parent" id="sub_btn"><img src="http://localhost:8080/shopping/images/login.gif" alt="登录"/></a></li>--%>

                <li class="a_c"><input type="submit" id="sub_btn" alt="登录"/></li>
                <!--错误信息显示地方 -->
                <li><span class="errorMsg"></span></li>
                <li class="desc">&delta;&nbsp;&nbsp;<a href="#">什么是安全登录</a>。</li>
                <li class="desc">&delta;&nbsp;&nbsp;香港會員（繁體中文用戶）由此<a href="#">登入</a></li>
                <li class="desc">&delta;&nbsp;&nbsp;<a href="#">密码安全贴士</a>。</li>
                <li class="desc">&delta;&nbsp;&nbsp;防止病毒或者木马窃取您的账户信息，<a href="#">在线检查</a>您的电脑是否安全。
                </li>
            </ul>
            <h1><img src="http://localhost:8080/shopping/images/register.gif" alt="注册会员"/></h1>
            <ul class="aside f_l">
                <li class="regpic"><span>便宜有好货！</span>超过7000万件商品任您选。</li>
                <li class="regpic regpic2"><span>买卖更安全！</span>交易超安全。</li>
                <li class="regpic regpic3"><span>免费开网店！</span>轻松赚钱交友。</li>
                <li class="regpic regpic4"><span>超人气社区！</span>彩活动每一天</li>
                <li class="a_c"><a href="http://localhost:8080/shopping/register.jsp" target="_parent"><img src="http://localhost:8080/shopping/images/registernow.gif"
                                                                             alt="现在就注册"/></a></li>
                <ul class="reged">
                    <li class="regpic regpic5">您已经是会员？<a href="http://localhost:8080/shopping/login.jsp" target="_parent">由此登入</a></li>
                    <li class="regpic regpic6">繁体中文用户由此<a href="http://localhost:8080/shopping/register.jsp" target="_parent">注册</a></li>
                </ul>
            </ul>
        </div>
    </form>
    <iframe id="footer" src="http://localhost:8080/shopping/footer.jsp" width="980" height="136" frameborder="0" scrolling="no"></iframe>
</div> <!--container end-->


</body>
</html>
